<?php
include("include/config.inc.php");
if(!isset($_SESSION['s_activId']))
{
  $_SESSION['s_urlRedirectDir'] = $_SERVER['REQUEST_URI'];
  header("Location:checkLogin.php");
}
else
{
  if(isset($_POST['submitBtn']))
  {
  	$partyName         = isset($_POST['partyName']) ? $_POST['partyName'] : "";
  	$phoneNumber       = isset($_POST['phoneNumber']) ? $_POST['phoneNumber'] : "";
  	
  	$insertParty =  "INSERT INTO party(partyName,phoneNumber)
  	                               VALUES('".$partyName."','".$phoneNumber."')";
  	$insertPartyRes = mysql_query($insertParty);
  	if(!$insertPartyRes)
  	{
  		echo "Insert Fail";
  	}
  	else
  	{
  		header("party.php");
  	}
  }
  
  include("./bottom.php");
  $smarty->display("party.tpl");
}  
?>